package com.ruoyi.web.controller.fenxi.utils;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.InputStreamReader;

public class CmdUtils {
    public static boolean processCMD(String command) {
        try {
            Process process = Runtime.getRuntime().exec(command);

            DataInputStream errinput = new DataInputStream(process.getErrorStream());
            BufferedReader errResult = new BufferedReader(new InputStreamReader(errinput));

            while ((errResult.readLine()) != null) {
//				System.out.println("errResult:" + errResult.readLine());
            }
            errResult.close();
            process.waitFor();
            process.destroy();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
}
